////<<<<<<< HEAD
////package cn.xspace.module.other.fragment;
////
////import android.content.ClipData;
////import android.content.Intent;
////import android.graphics.Bitmap;
////import android.net.Uri;
////import android.os.Bundle;
////import android.text.TextUtils;
////import android.util.Log;
////import android.view.LayoutInflater;
////import android.view.View;
////import android.view.View.OnClickListener;
////import android.webkit.WebChromeClient;
////import android.webkit.WebSettings;
////import android.webkit.WebView;
////import android.webkit.WebViewClient;
////import android.widget.TextView;
////import android.widget.Toast;
////
////import com.android.volley.RequestQueue;
////import com.android.volley.Response.ErrorListener;
////import com.android.volley.Response.Listener;
////import com.android.volley.VolleyError;
////import com.android.volley.toolbox.StringRequest;
////import com.android.volley.toolbox.Volley;
////import com.umeng.socialize.ShareAction;
////import com.umeng.socialize.UMShareAPI;
////import com.umeng.socialize.UMShareListener;
////import com.umeng.socialize.bean.SHARE_MEDIA;
////import com.xspace.android.xafcommon.base.BaseFragment;
////import com.xspace.android.xafcommon.util.Constants;
////import com.xspace.android.xafcommon.util.LogUtil;
////import com.xspace.android.xafcommon.util.Navigation;
////import com.xspace.android.xafcommon.util.RequestConstant;
////import com.xspace.android.xafcommon.util.T;
////import com.xspace.android.xafcommon.view.DialogSetTextSize;
////import com.xspace.android.xafcommon.view.dialog.ButtonClickListener;
////import com.xspace.android.xafcommon.view.dialog.WebviewOperationDialog;
////import com.xspace.android.xafcommon.view.rsv.RangeSliderView;
////
////import org.json.JSONArray;
////import org.json.JSONException;
////import org.json.JSONObject;
////
////import cn.xspace.app.view.TitleBar;
////import cn.xspace.library.util.BldNavigation;
////import cn.xspace.library.util.L;
////import cn.xspace.library.util.Tools;
////import cn.xspace.module.other.R;
////import cn.xspace.module.other.util.RProxy;
//<<<<<<< HEAD
////import cn.xspace.wnx.activity.MsgForwardActivity;
////import cn.xspace.chatui.bean.MessageEntity;
////import cn.xspace.chatui.bean.MsgRecordEntity;
////import cn.xspace.wnx.util.Navigator;
////import cn.xspace.wnx.util.T;
////import cn.xspace.wnx.view.DialogSetTextSize;
//=======
//>>>>>>> master
////
////
////public class PlatformWebViewFragment extends BaseFragment {
////    //	public static final String PARAM_WEB_URL = "param_web_url";
//////	public static final String PARAM_TITLE = "param_title";
////    public static final String PARAM_CONTENT = "param_content";
////    private WebView webView;
////    private String mUrl = "";
////    private String mTitle = "";
////    private String org_id = "";
////    private String m_Web_Title = "";
////    private String mContent = "";
////    private TitleBar mTitleBar = null;
////
////    public static PlatformWebViewFragment newInstance(String url, String title, String org_id) {
////        Bundle args = new Bundle();
////        args.putString(Constants.WEBVIEURL, url);
////        args.putString(Constants.TITITL, title);
////        args.putString(RequestConstant.KEY_ORG_ID, org_id);
////        PlatformWebViewFragment fragment = new PlatformWebViewFragment();
////        fragment.setArguments(args);
////        return fragment;
////    }
////
////    @Override
////    public View initView(LayoutInflater inflater) {
////        return inflater.inflate(getLayoutId(), null);
////    }
////
////    @Override
////    protected void initFindViewById(View view) {
////        webView = (WebView) view.findViewById(RProxy.webview);
////        mTitleBar = (TitleBar) view.findViewById(R.id.title_bar);
////        mTitleBar.setRightImageResource(R.drawable.icon_function_more);
////
////        initViews();
////        if (mUrl == null || Uri.parse(mUrl) == null) {
////            webView.loadUrl("file:///android_asset/index.html");
////        } else {
////            String tempurl = mUrl;
////            if (mUrl.contains("?")) {
////                tempurl += "&userid=" + Tools.getCurrentAccountInfo(mContext).uuid;
////            } else {
////                tempurl += "?userid=" + Tools.getCurrentAccountInfo(mContext).uuid;
////            }
////            webView.loadUrl(tempurl);
////        }
////    }
////
////    @Override
////    public void initData() {
////
////    }
////
////    @Override
////    protected void initEvent() {
////        super.initEvent();
////        mTitleBar.setRightLayoutClickListener(new OnClickListener() {
////            @Override
////            public void onClick(View v) {
////                showDialogButton();
////            }
////        });
////    }
////
////    WebChromeClient wcc = new WebChromeClient() {
////        public void onReceivedTitle(WebView view, String title) {
////            TextView tv = (TextView) mRoot.findViewById(RProxy.title);
////            tv.setText(title);
////        }
////
////        @Override
////        public void onProgressChanged(WebView view, int newProgress) {
////            L.v("newProgress>>>>" + newProgress);
////            super.onProgressChanged(view, newProgress);
////        }
////    };
////
////    @Override
////    public void onActivityResult(int requestCode, int resultCode, Intent data) {
////        super.onActivityResult(requestCode, resultCode, data);
////        UMShareAPI.get(mContext).onActivityResult(requestCode, resultCode, data);
////    }
////
////    @Override
////    protected void getIntentData() {
////        super.getIntentData();
////        if (fragmentArgs != null) {
////            mUrl = fragmentArgs.getString(Constants.WEBVIEURL);
////            mTitle = fragmentArgs.getString(Constants.TITITL);
////            mContent = fragmentArgs.getString(PARAM_CONTENT);
////            org_id = fragmentArgs.getString(RequestConstant.KEY_ORG_ID);
////        }
////    }
////
////    protected Integer getLayoutId() {
////        return R.layout.activity_webview;
////    }
////
////    public void onPause() {
////        super.onPause();
////        webView.onPause();
////    }
////
////    public void onResume() {
////        super.onResume();
////        webView.onResume();
////    }
////
////
////    protected void initViews() {
////        webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
////        webView.setHorizontalScrollBarEnabled(false);
////        WebSettings settings = webView.getSettings();
////        settings.setAllowFileAccess(true);
////        settings.setJavaScriptEnabled(true);
////        settings.setBuiltInZoomControls(true);
////        settings.setJavaScriptCanOpenWindowsAutomatically(true);
////        settings.setLoadsImagesAutomatically(true);
////        // settings.setPluginsEnabled(true);
////        settings.setBlockNetworkImage(false);
////        webView.setWebChromeClient(wcc);
////        webView.setWebViewClient(new WebViewClient() {
////            public boolean shouldOverrideUrlLoading(WebView view, String url) {
////                // if (url.indexOf(".doc") > 0 || url.indexOf(".pdf") > 0
////                // || url.indexOf(".xls") > 0 || url.indexOf(".ppt") > 0
////                // || url.indexOf(".wps") > 0 || url.indexOf(".et") > 0
////                // || url.indexOf(".dps") > 0) {
////                // Uri uri = Uri.parse(url);
////                // Intent intent = new Intent(Intent.ACTION_VIEW, uri);
////                // startActivity(intent);
////                //
////                // } else {
////                view.loadUrl(url);
////                // }
////                return true;
////            }
////
////            @Override
////            public void onPageFinished(WebView view, String url) {
////                super.onPageFinished(view, url);
////                //m_Web_Title=view.getTitle();
////                String title = view.getTitle();
////                if (!TextUtils.isEmpty(title) && !(title.endsWith(".html") || title.endsWith(".htm"))) {
////                    mTitle = title;
////                    m_Web_Title = title;
////                }
////                volleyGetShortUrl(mUrl);
////                Log.i("wnx", "onPageFinished PlatformWebViewAct m_Web_Title:" + m_Web_Title);
////            }
////
////            @Override
////            public void onPageStarted(WebView view, String url, Bitmap favicon) {
////                super.onPageStarted(view, url, favicon);
////            }
////
////            @Override
////            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
////                super.onReceivedError(view, errorCode, description, failingUrl);
////                webView.loadUrl("file:///android_asset/index.html");
////            }
////
////        });
////
////    }
////
////    private void showDialogButton() {
////        WebviewOperationDialog builder = new WebviewOperationDialog(mContext);
////
////        builder.setmListener(new WebviewOperationDialog.IOperateClickListener() {
////            @Override
////            public void clickListener(View v) {
////                if (v.getId() == R.id.linear_collect) {
////                    Navigation.startCollectActivity(mContext, mTitle, mUrl, "", 0);
////                } else if (v.getId() == R.id.linear_org) {
////                    if (TextUtils.isEmpty(org_id)) {
////                        T.showShort(mContext, "暂时无法查看");
////                    } else {
////                        BldNavigation.startOrgInfoActivity(mContext, org_id);
////                    }
////
////                } else if (v.getId() == R.id.linear_textsize_turn) {
////                    LogUtil.d("  textsize  ");
////                    //调整字体
////                    DialogSetTextSize.Builder builder = new DialogSetTextSize.Builder(mContext);
////                    builder.setListener(new DialogSetTextSize.ISeekbarListener() {
////                        @Override
////                        public void onProgressChanged(RangeSliderView rsv, int index) {
////                            webView.getSettings().setTextZoom(50 + index * 25);
////                        }
////                    }, new ButtonClickListener() {
////                        @Override
////                        public void buttonClick(View view) {
////
////                        }
////                    });
////=======
////>>>>>>> masterWnx
//////package cn.xspace.module.other.fragment;
//////
//////import android.content.ClipData;
//////import android.content.Intent;
//////import android.graphics.Bitmap;
//////import android.net.Uri;
//////import android.os.Bundle;
//////import android.text.TextUtils;
//////import android.util.Log;
//////import android.view.LayoutInflater;
//////import android.view.View;
//////import android.view.View.OnClickListener;
//////import android.webkit.WebChromeClient;
//////import android.webkit.WebSettings;
//////import android.webkit.WebView;
//////import android.webkit.WebViewClient;
//////import android.widget.TextView;
//////import android.widget.Toast;
////<<<<<<< HEAD
//////
//////import com.android.volley.RequestQueue;
//////import com.android.volley.Response.ErrorListener;
//////import com.android.volley.Response.Listener;
//////import com.android.volley.VolleyError;
//////import com.android.volley.toolbox.StringRequest;
//////import com.android.volley.toolbox.Volley;
//////import com.umeng.socialize.ShareAction;
//////import com.umeng.socialize.UMShareAPI;
//////import com.umeng.socialize.UMShareListener;
//////import com.umeng.socialize.bean.SHARE_MEDIA;
//////import com.xspace.android.xafcommon.base.BaseFragment;
//////import com.xspace.android.xafcommon.util.Constants;
//////import com.xspace.android.xafcommon.util.LogUtil;
//////import com.xspace.android.xafcommon.util.Navigation;
//////import com.xspace.android.xafcommon.util.RequestConstant;
//////import com.xspace.android.xafcommon.util.Tools;
//////import com.xspace.android.xafcommon.view.dialog.ButtonClickListener;
//////import com.xspace.android.xafcommon.view.dialog.WebviewOperationDialog;
//////import com.xspace.android.xafcommon.view.rsv.RangeSliderView;
//////
//////import org.json.JSONArray;
//////import org.json.JSONException;
//////import org.json.JSONObject;
//////
//////import cn.xspace.app.view.TitleBar;
//////import cn.xspace.library.util.L;
//////import cn.xspace.module.other.R;
//////import cn.xspace.module.other.util.RProxy;
//////import cn.xspace.wnx.activity.MsgForwardActivity;
//////import cn.xspace.wnx.entity.MessageEntity;
//////import cn.xspace.wnx.entity.MsgRecordEntity;
//////import cn.xspace.wnx.util.Navigator;
//////import cn.xspace.wnx.util.T;
//////import cn.xspace.wnx.view.DialogSetTextSize;
//////
//////
//////public class PlatformWebViewFragment extends BaseFragment {
//////    //	public static final String PARAM_WEB_URL = "param_web_url";
////////	public static final String PARAM_TITLE = "param_title";
//////    public static final String PARAM_CONTENT = "param_content";
//////    private WebView webView;
//////    private String mUrl = "";
//////    private String mTitle = "";
//////    private String org_id = "";
//////    private String m_Web_Title = "";
//////    private String mContent = "";
//////    private TitleBar mTitleBar = null;
//////
//////    public static PlatformWebViewFragment newInstance(String url, String title, String org_id) {
//////        Bundle args = new Bundle();
//////        args.putString(Constants.WEBVIEURL, url);
//////        args.putString(Constants.TITITL, title);
//////        args.putString(RequestConstant.KEY_ORG_ID, org_id);
//////        PlatformWebViewFragment fragment = new PlatformWebViewFragment();
//////        fragment.setArguments(args);
//////        return fragment;
//////    }
//////
//////    @Override
//////    public View initView(LayoutInflater inflater) {
//////        return inflater.inflate(getLayoutId(), null);
//////    }
//////
//////    @Override
//////    protected void initFindViewById(View view) {
//////        webView = (WebView) view.findViewById(RProxy.webview);
//////        mTitleBar = (TitleBar) view.findViewById(R.id.title_bar);
//////        mTitleBar.setRightImageResource(R.drawable.icon_function_more);
//////
//////        initViews();
//////        if (mUrl == null || Uri.parse(mUrl) == null) {
//////            webView.loadUrl("file:///android_asset/index.html");
//////        } else {
//////            String tempurl = mUrl;
//////            if (mUrl.contains("?")) {
//////                tempurl += "&userid=" + Tools.getCurrentAccountInfo(mContext).uuid;
//////            } else {
//////                tempurl += "?userid=" + Tools.getCurrentAccountInfo(mContext).uuid;
//////            }
//////            webView.loadUrl(tempurl);
//////        }
//////    }
//////
//////    @Override
//////    public void initData() {
//////
//////    }
//////
//////    @Override
//////    protected void initEvent() {
//////        super.initEvent();
//////        mTitleBar.setRightLayoutClickListener(new OnClickListener() {
//////            @Override
//////            public void onClick(View v) {
//////                showDialogButton();
//////            }
//////        });
//////    }
//////
//////    WebChromeClient wcc = new WebChromeClient() {
//////        public void onReceivedTitle(WebView view, String title) {
//////            TextView tv = (TextView) mRoot.findViewById(RProxy.title);
//////            tv.setText(title);
//////        }
//////
//////        @Override
//////        public void onProgressChanged(WebView view, int newProgress) {
//////            L.v("newProgress>>>>" + newProgress);
//////            super.onProgressChanged(view, newProgress);
//////        }
//////    };
//////
//////    @Override
//////    public void onActivityResult(int requestCode, int resultCode, Intent data) {
//////        super.onActivityResult(requestCode, resultCode, data);
//////        UMShareAPI.get(mContext).onActivityResult(requestCode, resultCode, data);
//////    }
//////
//////    @Override
//////    protected void getIntentData() {
//////        super.getIntentData();
//////        if (fragmentArgs != null) {
//////            mUrl = fragmentArgs.getString(Constants.WEBVIEURL);
//////            mTitle = fragmentArgs.getString(Constants.TITITL);
//////            mContent = fragmentArgs.getString(PARAM_CONTENT);
//////            org_id = fragmentArgs.getString(RequestConstant.KEY_ORG_ID);
//////        }
//////    }
//////
//////    protected Integer getLayoutId() {
//////        return R.layout.activity_webview;
//////    }
//////
//////    public void onPause() {
//////        super.onPause();
//////        webView.onPause();
//////    }
//////
//////    public void onResume() {
//////        super.onResume();
//////        webView.onResume();
//////    }
//////
//////
//////    protected void initViews() {
//////        webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
//////        webView.setHorizontalScrollBarEnabled(false);
//////        WebSettings settings = webView.getSettings();
//////        settings.setAllowFileAccess(true);
//////        settings.setJavaScriptEnabled(true);
//////        settings.setBuiltInZoomControls(true);
//////        settings.setJavaScriptCanOpenWindowsAutomatically(true);
//////        settings.setLoadsImagesAutomatically(true);
//////        // settings.setPluginsEnabled(true);
//////        settings.setBlockNetworkImage(false);
//////        webView.setWebChromeClient(wcc);
//////        webView.setWebViewClient(new WebViewClient() {
//////            public boolean shouldOverrideUrlLoading(WebView view, String url) {
//////                // if (url.indexOf(".doc") > 0 || url.indexOf(".pdf") > 0
//////                // || url.indexOf(".xls") > 0 || url.indexOf(".ppt") > 0
//////                // || url.indexOf(".wps") > 0 || url.indexOf(".et") > 0
//////                // || url.indexOf(".dps") > 0) {
//////                // Uri uri = Uri.parse(url);
//////                // Intent intent = new Intent(Intent.ACTION_VIEW, uri);
//////                // startActivity(intent);
//////                //
//////                // } else {
//////                view.loadUrl(url);
//////                // }
//////                return true;
//////            }
//////
//////            @Override
//////            public void onPageFinished(WebView view, String url) {
//////                super.onPageFinished(view, url);
//////                //m_Web_Title=view.getTitle();
//////                String title = view.getTitle();
//////                if (!TextUtils.isEmpty(title) && !(title.endsWith(".html") || title.endsWith(".htm"))) {
//////                    mTitle = title;
//////                    m_Web_Title = title;
//////                }
//////                volleyGetShortUrl(mUrl);
//////                Log.i("wnx", "onPageFinished PlatformWebViewAct m_Web_Title:" + m_Web_Title);
//////            }
//////
//////            @Override
//////            public void onPageStarted(WebView view, String url, Bitmap favicon) {
//////                super.onPageStarted(view, url, favicon);
//////            }
//////
//////            @Override
//////            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
//////                super.onReceivedError(view, errorCode, description, failingUrl);
//////                webView.loadUrl("file:///android_asset/index.html");
//////            }
//////
//////        });
//////
//////    }
//////
//////    private void showDialogButton() {
//////        WebviewOperationDialog builder = new WebviewOperationDialog(mContext);
//////
//////        builder.setmListener(new WebviewOperationDialog.IOperateClickListener() {
//////            @Override
//////            public void clickListener(View v) {
//////                if (v.getId() == R.id.linear_collect) {
//////                    Navigation.startCollectActivity(mContext, mTitle, mUrl, "", 0);
//////                } else if (v.getId() == R.id.linear_org) {
//////                    if (TextUtils.isEmpty(org_id)) {
//////                        T.showShort(mContext, "暂时无法查看");
//////                    } else {
//////                        Navigator.startOrgInfoActivity(mContext, org_id);
//////                    }
//////
//////                } else if (v.getId() == R.id.linear_textsize_turn) {
//////                    LogUtil.d("  textsize  ");
//////                    //调整字体
//////                    DialogSetTextSize.Builder builder = new DialogSetTextSize.Builder(mContext);
////
////                    builder.show();
////                } else if (v.getId() == R.id.linear_refresh) {
////                    //刷新
////                    webView.reload();
////                } else if (v.getId() == R.id.linear_forward) {
////                    BldNavigation.wnxMsgForwar(mContext, mUrl, mTitle);
////
////
//////                    MsgRecordEntity turnBean = new MsgRecordEntity();
//////                    turnBean.msg_content_type = MessageEntity.ContentType.OTHER.toNumber();
//////                    turnBean.msg_content = mTitle + Constants.CHAR_SPECIAL + mUrl;
//////                    Bundle mBundle = new Bundle();
//////                    mBundle.putSerializable(MsgForwardActivity.FORWARD_ENTITY, turnBean);
//////                    //转发
//////                    Navigator.startForwardActivity(mContext, mBundle);
////                } else if (v.getId() == R.id.linear_link_copy) {
////                    //复制链接
////                    clipboard.setPrimaryClip(ClipData.newPlainText(null,
////                            (m_Web_Title)));
////                    T.showShort(mContext, R.string.content_copyed);
////
////                } else if (v.getId() == R.id.linear_share) {
////                    LogUtil.d("share//////");
////                    //分享
////                    new ShareAction(getActivity()).setDisplayList(SHARE_MEDIA.SINA, SHARE_MEDIA.QQ, SHARE_MEDIA.QZONE, SHARE_MEDIA.WEIXIN, SHARE_MEDIA.WEIXIN_CIRCLE, SHARE_MEDIA.WEIXIN_FAVORITE, SHARE_MEDIA.MORE)
////                            .withTitle(mTitle)
////                            .withText(TextUtils.isEmpty(mContent) ? "12316云.农业微门户系统，是基于云服务模式的的农业管理与服务的O2O解决方案。12316云门户APP是农民贴身的农技员和信息站。" : mContent)
//////                            .withMedia(new UMImage(PlatformWebViewAct.this, "mediaUrl"))
////                            .withTargetUrl(mUrl)
////                            .setCallback(umShareListener)
////                            .open();
////
////                } else if (v.getId() == R.id.linear_browser) {
////                    Intent intent = new Intent();
////                    intent.setAction("android.intent.action.VIEW");
////                    Uri content_url = Uri.parse(mUrl);
////                    intent.setData(content_url);
////                    startActivity(intent);
////                } else if (v.getId() == R.id.layout_cancel) {
////
////                }
////            }
////        });
////        builder.show();
////        builder.setCancelable(false);
////    }
////
////    private UMShareListener umShareListener = new UMShareListener() {
////        @Override
////        public void onResult(SHARE_MEDIA platform) {
////            com.umeng.socialize.utils.Log.d("plat", "platform" + platform);
////            if (platform.name().equals("WEIXIN_FAVORITE")) {
////                Toast.makeText(mContext, platform + " 收藏成功啦", Toast.LENGTH_SHORT).show();
////            } else {
////                Toast.makeText(mContext, platform + " 分享成功啦", Toast.LENGTH_SHORT).show();
////            }
////        }
////
////        @Override
////        public void onError(SHARE_MEDIA platform, Throwable t) {
////            Toast.makeText(mContext, platform + " 分享失败啦", Toast.LENGTH_SHORT).show();
////            if (t != null) {
////                com.umeng.socialize.utils.Log.d("throw", "throw:" + t.getMessage());
////            }
////        }
////
////        @Override
////        public void onCancel(SHARE_MEDIA platform) {
////            Toast.makeText(mContext, platform + " 分享取消了", Toast.LENGTH_SHORT).show();
////        }
////    };
////
////    private RequestQueue mRequestQueue;
////    private StringRequest mStringRequest;
////
////    private void volleyGetShortUrl(String url_param) {
////        if (TextUtils.isEmpty(url_param))
////            return;
////
////        LogUtil.d("wnx", "volley_get platform url_param:" + url_param);
////        String url = "http://api.t.sina.com.cn/short_url/shorten.json?source=3213676317&url_long=" + url_param;
////        // 1 创建RequestQueue对象
////        mRequestQueue = Volley.newRequestQueue(mContext);
////        // 2 创建StringRequest对象
////        mStringRequest = new StringRequest(url, new Listener<String>() {
////            @Override
////            public void onResponse(String response) {
////                LogUtil.v("wnx", "volleyGetShortUrl onResponse info:" + response);
////                try {
////                    JSONArray jsArr = new JSONArray(response);
////                    JSONObject js = jsArr.getJSONObject(0);
////                    String url_short = js.getString("url_short");
////                    if (!TextUtils.isEmpty(url_short)) {
////                        mUrl = url_short;
////                    }
////                } catch (JSONException e) {
////                    // TODO Auto-generated catch block
////                    e.printStackTrace();
////                }
////            }
////        }, new ErrorListener() {
////            @Override
////            public void onErrorResponse(VolleyError error) {
////                LogUtil.v("exweb", "volleyGetShortUrl onErrorResponse info:" + error.toString());
////            }
////
////        });
////        // 3 将StringRequest添加到RequestQueue
////        mRequestQueue.add(mStringRequest);
////    }
////}
////
////=======
//////
//////import com.android.volley.RequestQueue;
//////import com.android.volley.Response.ErrorListener;
//////import com.android.volley.Response.Listener;
//////import com.android.volley.VolleyError;
//////import com.android.volley.toolbox.StringRequest;
//////import com.android.volley.toolbox.Volley;
//////import com.umeng.socialize.ShareAction;
//////import com.umeng.socialize.UMShareAPI;
//////import com.umeng.socialize.UMShareListener;
//////import com.umeng.socialize.bean.SHARE_MEDIA;
//////import com.xspace.android.xafcommon.base.BaseFragment;
//////import com.xspace.android.xafcommon.util.Constants;
//////import com.xspace.android.xafcommon.util.LogUtil;
//////import com.xspace.android.xafcommon.util.Navigation;
//////import com.xspace.android.xafcommon.util.RequestConstant;
//////import com.xspace.android.xafcommon.util.Tools;
//////import com.xspace.android.xafcommon.view.dialog.ButtonClickListener;
//////import com.xspace.android.xafcommon.view.dialog.WebviewOperationDialog;
//////import com.xspace.android.xafcommon.view.rsv.RangeSliderView;
//////
//////import org.json.JSONArray;
//////import org.json.JSONException;
//////import org.json.JSONObject;
//////
//////import cn.xspace.app.view.TitleBar;
//////import cn.xspace.library.util.L;
//////import cn.xspace.module.other.R;
//////import cn.xspace.module.other.util.RProxy;
//////import cn.xspace.wnx.activity.MsgForwardActivity;
//////import cn.xspace.wnx.entity.MessageEntity;
//////import cn.xspace.wnx.entity.MsgRecordEntity;
//////import cn.xspace.wnx.util.Navigator;
//////import cn.xspace.wnx.util.T;
//////import cn.xspace.wnx.view.DialogSetTextSize;
//////
//////
//////public class PlatformWebViewFragment extends BaseFragment {
//////    //	public static final String PARAM_WEB_URL = "param_web_url";
////////	public static final String PARAM_TITLE = "param_title";
//////    public static final String PARAM_CONTENT = "param_content";
//////    private WebView webView;
//////    private String mUrl = "";
//////    private String mTitle = "";
//////    private String org_id = "";
//////    private String m_Web_Title = "";
//////    private String mContent = "";
//////    private TitleBar mTitleBar = null;
//////
//////    public static PlatformWebViewFragment newInstance(String url, String title, String org_id) {
//////        Bundle args = new Bundle();
//////        args.putString(Constants.WEBVIEURL, url);
//////        args.putString(Constants.TITITL, title);
//////        args.putString(RequestConstant.KEY_ORG_ID, org_id);
//////        PlatformWebViewFragment fragment = new PlatformWebViewFragment();
//////        fragment.setArguments(args);
//////        return fragment;
//////    }
//////
//////    @Override
//////    public View initView(LayoutInflater inflater) {
//////        return inflater.inflate(getLayoutId(), null);
//////    }
//////
//////    @Override
//////    protected void initFindViewById(View view) {
//////        webView = (WebView) view.findViewById(RProxy.webview);
//////        mTitleBar = (TitleBar) view.findViewById(R.id.title_bar);
//////        mTitleBar.setRightImageResource(R.drawable.icon_function_more);
//////
//////        initViews();
//////        if (mUrl == null || Uri.parse(mUrl) == null) {
//////            webView.loadUrl("file:///android_asset/index.html");
//////        } else {
//////            String tempurl = mUrl;
//////            if (mUrl.contains("?")) {
//////                tempurl += "&userid=" + Tools.getCurrentAccountInfo(mContext).uuid;
//////            } else {
//////                tempurl += "?userid=" + Tools.getCurrentAccountInfo(mContext).uuid;
//////            }
//////            webView.loadUrl(tempurl);
//////        }
//////    }
//////
//////    @Override
//////    public void initData() {
//////
//////    }
//////
//////    @Override
//////    protected void initEvent() {
//////        super.initEvent();
//////        mTitleBar.setRightLayoutClickListener(new OnClickListener() {
//////            @Override
//////            public void onClick(View v) {
//////                showDialogButton();
//////            }
//////        });
//////    }
//////
//////    WebChromeClient wcc = new WebChromeClient() {
//////        public void onReceivedTitle(WebView view, String title) {
//////            TextView tv = (TextView) mRoot.findViewById(RProxy.title);
//////            tv.setText(title);
//////        }
//////
//////        @Override
//////        public void onProgressChanged(WebView view, int newProgress) {
//////            L.v("newProgress>>>>" + newProgress);
//////            super.onProgressChanged(view, newProgress);
//////        }
//////    };
//////
//////    @Override
//////    public void onActivityResult(int requestCode, int resultCode, Intent data) {
//////        super.onActivityResult(requestCode, resultCode, data);
//////        UMShareAPI.get(mContext).onActivityResult(requestCode, resultCode, data);
//////    }
//////
//////    @Override
//////    protected void getIntentData() {
//////        super.getIntentData();
//////        if (fragmentArgs != null) {
//////            mUrl = fragmentArgs.getString(Constants.WEBVIEURL);
//////            mTitle = fragmentArgs.getString(Constants.TITITL);
//////            mContent = fragmentArgs.getString(PARAM_CONTENT);
//////            org_id = fragmentArgs.getString(RequestConstant.KEY_ORG_ID);
//////        }
//////    }
//////
//////    protected Integer getLayoutId() {
//////        return R.layout.activity_webview;
//////    }
//////
//////    public void onPause() {
//////        super.onPause();
//////        webView.onPause();
//////    }
//////
//////    public void onResume() {
//////        super.onResume();
//////        webView.onResume();
//////    }
//////
//////
//////    protected void initViews() {
//////        webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
//////        webView.setHorizontalScrollBarEnabled(false);
//////        WebSettings settings = webView.getSettings();
//////        settings.setAllowFileAccess(true);
//////        settings.setJavaScriptEnabled(true);
//////        settings.setBuiltInZoomControls(true);
//////        settings.setJavaScriptCanOpenWindowsAutomatically(true);
//////        settings.setLoadsImagesAutomatically(true);
//////        // settings.setPluginsEnabled(true);
//////        settings.setBlockNetworkImage(false);
//////        webView.setWebChromeClient(wcc);
//////        webView.setWebViewClient(new WebViewClient() {
//////            public boolean shouldOverrideUrlLoading(WebView view, String url) {
//////                // if (url.indexOf(".doc") > 0 || url.indexOf(".pdf") > 0
//////                // || url.indexOf(".xls") > 0 || url.indexOf(".ppt") > 0
//////                // || url.indexOf(".wps") > 0 || url.indexOf(".et") > 0
//////                // || url.indexOf(".dps") > 0) {
//////                // Uri uri = Uri.parse(url);
//////                // Intent intent = new Intent(Intent.ACTION_VIEW, uri);
//////                // startActivity(intent);
//////                //
//////                // } else {
//////                view.loadUrl(url);
//////                // }
//////                return true;
//////            }
//////
//////            @Override
//////            public void onPageFinished(WebView view, String url) {
//////                super.onPageFinished(view, url);
//////                //m_Web_Title=view.getTitle();
//////                String title = view.getTitle();
//////                if (!TextUtils.isEmpty(title) && !(title.endsWith(".html") || title.endsWith(".htm"))) {
//////                    mTitle = title;
//////                    m_Web_Title = title;
//////                }
//////                volleyGetShortUrl(mUrl);
//////                Log.i("wnx", "onPageFinished PlatformWebViewAct m_Web_Title:" + m_Web_Title);
//////            }
//////
//////            @Override
//////            public void onPageStarted(WebView view, String url, Bitmap favicon) {
//////                super.onPageStarted(view, url, favicon);
//////            }
//////
//////            @Override
//////            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
//////                super.onReceivedError(view, errorCode, description, failingUrl);
//////                webView.loadUrl("file:///android_asset/index.html");
//////            }
//////
//////        });
//////
//////    }
//////
//////    private void showDialogButton() {
//////        WebviewOperationDialog builder = new WebviewOperationDialog(mContext);
//////
//////        builder.setmListener(new WebviewOperationDialog.IOperateClickListener() {
//////            @Override
//////            public void clickListener(View v) {
//////                if (v.getId() == R.id.linear_collect) {
//////                    Navigation.startCollectActivity(mContext, mTitle, mUrl, "", 0);
//////                } else if (v.getId() == R.id.linear_org) {
//////                    if (TextUtils.isEmpty(org_id)) {
//////                        T.showShort(mContext, "暂时无法查看");
//////                    } else {
//////                        Navigator.startOrgInfoActivity(mContext, org_id);
//////                    }
//////
//////                } else if (v.getId() == R.id.linear_textsize_turn) {
//////                    LogUtil.d("  textsize  ");
//////                    //调整字体
//////                    DialogSetTextSize.Builder builder = new DialogSetTextSize.Builder(mContext);
//////                    builder.setListener(new DialogSetTextSize.ISeekbarListener() {
//////                        @Override
//////                        public void onProgressChanged(RangeSliderView rsv, int index) {
//////                            webView.getSettings().setTextZoom(50 + index * 25);
//////                        }
//////                    }, new ButtonClickListener() {
//////                        @Override
//////                        public void buttonClick(View view) {
//////
//////                        }
//////                    });
////////                    builder.setListener(new DialogSetTextSize.ISeekbarListener() {
////////                        @Override
////////                        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
////////                            LogUtil.d(progress + "");
////////                            webView.getSettings().setTextZoom(100 + progress - 50);
////////                        }
////////
////////                        @Override
////////                        public void onStartTrackingTouch(SeekBar seekBar) {
////////                            LogUtil.d("begin");
////////                        }
////////
////////                        @Override
////////                        public void onStopTrackingTouch(SeekBar seekBar) {
////////                            LogUtil.d("stop");
////////                        }
////////                    });
//////                    builder.show();
//////                } else if (v.getId() == R.id.linear_refresh) {
//////                    //刷新
//////                    webView.reload();
//////                } else if (v.getId() == R.id.linear_forward) {
//////                    MsgRecordEntity turnBean = new MsgRecordEntity();
//////                    turnBean.msg_content_type = MessageEntity.ContentType.OTHER.toNumber();
//////                    turnBean.msg_content = mTitle + Constants.CHAR_SPECIAL + mUrl;
//////                    Bundle mBundle = new Bundle();
//////                    mBundle.putSerializable(MsgForwardActivity.FORWARD_ENTITY, turnBean);
//////                    //转发
//////                    Navigator.startForwardActivity(mContext, mBundle);
//////                } else if (v.getId() == R.id.linear_link_copy) {
//////                    //复制链接
//////                    clipboard.setPrimaryClip(ClipData.newPlainText(null,
//////                            (m_Web_Title)));
//////                    T.showShort(mContext, R.string.content_copyed);
//////
//////                } else if (v.getId() == R.id.linear_share) {
//////                    LogUtil.d("share//////");
//////                    //分享
//////                    new ShareAction(getActivity()).setDisplayList(SHARE_MEDIA.SINA, SHARE_MEDIA.QQ, SHARE_MEDIA.QZONE, SHARE_MEDIA.WEIXIN, SHARE_MEDIA.WEIXIN_CIRCLE, SHARE_MEDIA.WEIXIN_FAVORITE, SHARE_MEDIA.MORE)
//////                            .withTitle(mTitle)
//////                            .withText(TextUtils.isEmpty(mContent) ? "12316云.农业微门户系统，是基于云服务模式的的农业管理与服务的O2O解决方案。12316云门户APP是农民贴身的农技员和信息站。" : mContent)
////////                            .withMedia(new UMImage(PlatformWebViewAct.this, "mediaUrl"))
//////                            .withTargetUrl(mUrl)
//////                            .setCallback(umShareListener)
//////                            .open();
//////
//////                } else if (v.getId() == R.id.linear_browser) {
//////                    Intent intent = new Intent();
//////                    intent.setAction("android.intent.action.VIEW");
//////                    Uri content_url = Uri.parse(mUrl);
//////                    intent.setData(content_url);
//////                    startActivity(intent);
//////                } else if (v.getId() == R.id.layout_cancel) {
//////
//////                }
//////            }
//////        });
//////        builder.show();
//////        builder.setCancelable(false);
//////    }
//////
//////    private UMShareListener umShareListener = new UMShareListener() {
//////        @Override
//////        public void onResult(SHARE_MEDIA platform) {
//////            com.umeng.socialize.utils.Log.d("plat", "platform" + platform);
//////            if (platform.name().equals("WEIXIN_FAVORITE")) {
//////                Toast.makeText(mContext, platform + " 收藏成功啦", Toast.LENGTH_SHORT).show();
//////            } else {
//////                Toast.makeText(mContext, platform + " 分享成功啦", Toast.LENGTH_SHORT).show();
//////            }
//////        }
//////
//////        @Override
//////        public void onError(SHARE_MEDIA platform, Throwable t) {
//////            Toast.makeText(mContext, platform + " 分享失败啦", Toast.LENGTH_SHORT).show();
//////            if (t != null) {
//////                com.umeng.socialize.utils.Log.d("throw", "throw:" + t.getMessage());
//////            }
//////        }
//////
//////        @Override
//////        public void onCancel(SHARE_MEDIA platform) {
//////            Toast.makeText(mContext, platform + " 分享取消了", Toast.LENGTH_SHORT).show();
//////        }
//////    };
//////
//////    private RequestQueue mRequestQueue;
//////    private StringRequest mStringRequest;
//////
//////    private void volleyGetShortUrl(String url_param) {
//////        if (TextUtils.isEmpty(url_param))
//////            return;
//////
//////        LogUtil.d("wnx", "volley_get platform url_param:" + url_param);
//////        String url = "http://api.t.sina.com.cn/short_url/shorten.json?source=3213676317&url_long=" + url_param;
//////        // 1 创建RequestQueue对象
//////        mRequestQueue = Volley.newRequestQueue(mContext);
//////        // 2 创建StringRequest对象
//////        mStringRequest = new StringRequest(url, new Listener<String>() {
//////            @Override
//////            public void onResponse(String response) {
//////                LogUtil.v("wnx", "volleyGetShortUrl onResponse info:" + response);
//////                try {
//////                    JSONArray jsArr = new JSONArray(response);
//////                    JSONObject js = jsArr.getJSONObject(0);
//////                    String url_short = js.getString("url_short");
//////                    if (!TextUtils.isEmpty(url_short)) {
//////                        mUrl = url_short;
//////                    }
//////                } catch (JSONException e) {
//////                    // TODO Auto-generated catch block
//////                    e.printStackTrace();
//////                }
//////            }
//////        }, new ErrorListener() {
//////            @Override
//////            public void onErrorResponse(VolleyError error) {
//////                LogUtil.v("exweb", "volleyGetShortUrl onErrorResponse info:" + error.toString());
//////            }
//////
//////        });
//////        // 3 将StringRequest添加到RequestQueue
//////        mRequestQueue.add(mStringRequest);
//////    }
//////}
////>>>>>>> masterWnx
